<!DOCTYPE html>
<html lang="en">
<head>
    <th:block th:include="include :: header('未排课记上课')"/>
</head>
<body class="gray-bg">
<form class="form-horizontal m" id="form-record-nonscheduled">
    <div class="row">
        <div class="container-div">
            <div class="col-sm-12 search-collapse">
                <form id="export-form">
                    <div class="select-list">
                        <ul>
                            <li>
                                <!--                                <input type="hidden" name="params[classId]" th:value="${teachingClasses.classId}">-->
                                <!--                                <input type="hidden" name="courseId" th:value="${teachingClasses.courseId}">-->
                                班级：<input type="text" name="className" value=""/>
                            </li>
                            <li>
                                <a class="btn btn-primary btn-rounded btn-sm"
                                   onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
                                <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i
                                        class="fa fa-refresh"></i>&nbsp;重置</a>
                            </li>
                        </ul>
                    </div>
                </form>
            </div>
            <div class="col-sm-12 select-table table-striped">
                <table id="bootstrap-table"></table>
            </div>
        </div>
    </div>
</form>
<div th:include="include :: footer"></div>
<script th:inline="javascript">
    var prefix = ctx + "teaching/classes";

    $(function () {
        var options = {
            url: prefix + "/list",
            showSearch: false,
            showRefresh: false,
            showToggle: false,
            showColumns: false,
            columns: [{
                radio: true,
            },
                {
                    field: 'classId',
                    title: '班级主键ID',
                    visible: false
                },
                {
                    field: 'className',
                    title: '班级'
                },
                {
                    field: 'teachingSchool.name',
                    title: '上课校区'
                },
                {
                    field: 'teacherName',
                    title: '教师'
                },
                {
                    field: 'classStudent',
                    title: '人数'
                },
                {
                    field: 'startDate',
                    title: '开班时间',
                    formatter: function (value, row, index) {
                        return $.common.dateFormat(value);
                    }

                }
            ]
        };
        $.table.init(options);
    });

    /* 添加用户-选择用户-提交 */
    function submitHandler() {
        var classId = $.table.selectFirstColumns();
        var url = ctx + "teaching/record/tmpConsume/"
        if (classId.length == 0) {
            $.modal.alertWarning("请选择一条记录");
        } else {
            $.modal.openTab("记上课",url + classId);
            $.modal.close();
        }

    }
</script>
</body>
</html>